import urandom as random
from machine import Pin, SPI
from st7789py import ST7789, color565
from romfonts import vga2_bold_16x32 as font
import utime

# TFT
TFT_w = 240
TFT_H = 240

# 创建TFT对象
tft = ST7789(SPI(2, 80_000_000), TFT_w, TFT_H, reset=Pin(15), dc=Pin(2), cs=Pin(5), backlight=Pin(22))
            
            
if __name__ == "__main__":
    
    # 屏幕显示蓝色
    tft.fill(0)

    # 显示文字
    n = 0
    while True:
        n += 1
        tft.text(font, f"Hello {n}", 10, 10)
        utime.sleep_ms(500)

    
    
    while True:
        pass
       
       
       
       
